Vim8 から neovim に移行する
モチベ
手順
インストール
brew install neovim
nvim
:help nvim-from-vimを読む
~/.config/nvim/init.vim 作成
code:_
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc
ttymouseoptionを書き換える
code:.vimrc
if !has('nvim')
set ttymouse=xterm2
endif
vimと共存するためシンボリックリンクとかで設定ファイルやautoloadのディテクトリを共有 dotfilesで管理してるのでdotfilesベースで
code:sh
ln -s ~/dotfiles/vim/nvim/init.vim ~/.config/nvim/init.vim
ln -s ~/dotfiles/vim/.vim/* ~/.config/nvim/
最終的に~/.vim と ~/.config/nvim の中身が init.vim以外同じになってれば良い
ここから:checkhealthで発生している問題を確認しながら解決していく
.tmux.confの変更
code:.tmux.conf
# color
set -g default-terminal "screen-256color"
set-option -sa terminal-overrides ",screen-256color:RGB"
.zshrcの変更
code:.zshrc
export TERM=screen-256color
set termguicolors
ebiken.iconよくわからん
code:_
## tmux
- OK: escape-time: 1ms
- INFO: $TERM: xterm-256color
- INFO: default-terminal: screen-256color
- ERROR: $TERM differs from the tmux default-terminal setting. Colors might look wrong.
- ADVICE:
- $TERM may have been set by some rc (.bashrc, .zshrc, ...).
- WARNING: Neither Tc nor RGB capability set. True colors are disabled. 'termguicolors' won't work properly.
- ADVICE:
- Put this in your ~/.tmux.conf and replace XXX by your $TERM outside of tmux:
set-option -sa terminal-overrides ',XXX:RGB'
- For older tmux versions use this instead:
set-option -ga terminal-overrides ',XXX:Tc'
python2 -m pip install --user --upgrade pynvim
code:_
## Python 2 provider (optional)
- INFO: pyenv: Path: /usr/local/Cellar/pyenv/1.2.20/libexec/pyenv
- WARNING: pyenv: Root does not exist: /Users/ebiken/.pyenv. Ignoring pyenv for all following checks.
- WARNING: No Python executable found that can import neovim. Using the first available executable for diagnostics.
- ERROR: Python provider error:
- ADVICE:
- provider/pythonx: Could not load Python 2:
/usr/bin/python2 does not have the "neovim" module. :help provider-python
/usr/bin/python2.7 does not have the "neovim" module. :help provider-python
python2.6 not found in search path or not executable.
/usr/bin/python does not have the "neovim" module. :help provider-python
- INFO: Executable: Not found
python3 -m pip install --user --upgrade pynvim
code:_
## Python 3 provider (optional)
- INFO: pyenv: Path: /usr/local/Cellar/pyenv/1.2.20/libexec/pyenv
- WARNING: pyenv: Root does not exist: /Users/ebiken/.pyenv. Ignoring pyenv for all following checks.
- WARNING: No Python executable found that can import neovim. Using the first available executable for diagnostics.
- ERROR: Python provider error:
- ADVICE:
- provider/pythonx: Could not load Python 3:
/usr/local/bin/python3 does not have the "neovim" module. :help provider-python
python3.7 not found in search path or not executable.
python3.6 not found in search path or not executable.
python3.5 not found in search path or not executable.
python3.4 not found in search path or not executable.
python3.3 not found in search path or not executable.
/usr/bin/python is Python 2.7 and cannot provide Python 3.
- INFO: Executable: Not found
sudo gem install neovim
code:_
## Ruby provider (optional)
- WARNING: neovim-ruby-host not found.
- ADVICE:
- Run gem install neovim to ensure the neovim RubyGem is installed.
- Run gem environment to ensure the gem bin directory is in $PATH.
- If you are using rvm/rbenv/chruby, try "rehashing".
- See :help g:ruby_host_prog for non-standard gem installations.
npm i -g neovim
code:_
## Node.js provider (optional)
- INFO: Node.js: v14.5.0
- WARNING: Missing "neovim" npm (or yarn) package.
- ADVICE:
- Run in shell: npm install -g neovim
- Run in shell (if you use yarn): yarn global add neovim
:checkhealth以外で発生したエラー
clipboard
code:_
Error detected while processing /Users/ebiken/dotfiles/vim/base.vim:
line 103:
E474: Invalid argument: clipboard=unnamed,autoselect
nvimのときはautoselectを指定しないようにして解決
サポートしてないらしい
code:.vimrc
if has('nvim')
set clipboard=unnamed
else
set clipboard=unnamed,autoselect
endif
移行した結果
左 neovim、右 vim8
https://gyazo.com/5e8f4a67bc39c9267b7ca03d5d47134b
速さの違いはまだわからない。大きなファイルを扱うときに違いが出るかも?